﻿using LiveCharts;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace Manson.PrismWPFUIBase.Views
{
    public class PercentConverter : IValueConverter
    {
        
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ChartPoint chartPoint = (ChartPoint)value;
            string percent = (chartPoint.Participation * 100).ToString("0.000");
            string res = $"%{percent}%";
            return res;

        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
